﻿using System;

namespace IupNET
{
    public class FontDlg:IupBase
    {

        public FontDlg()
            : base(Iupc.FontDlg())
        {

        }

        public string PreviewText
        {
            get
            {
                return GetAttribute("PREVIEWTEXT");
            }
            set
            {
                SetAttribute("PREVIEWTEXT", value);
            }
        }

        
        public string Title
        {
            get
            {
                return GetAttribute("TITLE");
            }
            set
            {
                SetAttribute("TITLE", value);
            }
        }

        public Color Color
        {
            get
            {
                return Convert.StringToColor(GetAttribute("COLOR"));
            }
            set
            {
                SetAttribute("COLOR", Convert.ColorToString(value));
            }
        }

        public Dialog ParentDialog
        {
            get
            {
                return GetHandle(GetAttribute("PARENTDIALOG")) as Dialog;
            }

            set
            {
                SetAttribute("PARENTDIALOG", value.HandleName);
            }
        }

        public bool Status
        {
            get
            {
                return GetAttribute("STATUS") == "1";
            }
        }

        public string Value
        {
            get
            {
                return GetAttribute("VALUE");
            }
            set
            {
                SetAttribute("VALUE", value);
            }
        }

        public void Popup(int x, int y)
        {
            Iupc.Popup(cobject, x, y);
        }

        public EventCallback HelpCB
        {
            get
            {
                return CBHandler.Fetch("HELP_CB");
            }
            set
            {
                CBHandler.Set("HELP_CB", value);
            }
        }


        
    }
}
